package cn.ilikes.tools.nosql.jpa.clients;

import cn.ilikes.tools.nosql.jpa.graphs.Node;
import cn.ilikes.tools.nosql.jpa.metadatas.EntityMetaData;

public interface Client {

	public void init();

	public void flush();

	public boolean isOpen();

	public void rollback();

	public void commit();

	public void close();

	public Node findById(EntityMetaData entityMetaData, Object key) throws JPASQLClientsException;

	public Node load(EntityMetaData entityMetaData, Object key) throws JPASQLClientsException;

	public Node save(Node node) throws JPASQLClientsException;

	public void delete(Node node) throws JPASQLClientsException;

	public Node update(Node node) throws JPASQLClientsException;

	public Long selectSizeByKeyId(Object keyId, EntityMetaData entityMetaData) throws JPASQLClientsException;

}